package com.achievement.mapper;

import com.achievement.domain.dto.AllAchievementDTO;
import com.achievement.domain.entity.AllAchievementEntity;
import com.achievement.domain.param.AllAchievementParam;
import com.achievement.domain.vo.AllAchievementVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


public interface AllAchievementMapper extends BaseMapper<AllAchievementEntity> {

    List<AllAchievementVO> getList(@Param(value = "param") AllAchievementParam param, @Param(value = "authorName") String authorName, @Param(value = "userId") String userId);

    List<Map<String, String>> groupByType(@Param(value = "userId") String userId);

    List<Map<String, String>> groupByYear(@Param(value = "userId") String userId);

    //获取当前人员参与的成果数量
    int countByPIds(@Param(value = "userId") String userId);

    //获取当前人员作为第一作者参与的成果数量
    int countByFirstAuthor(@Param(value = "authorName") String authorName, @Param(value = "userId") String userId);

    List<AllAchievementVO> selectByDTONew(@Param(value = "dtos") List<AllAchievementDTO> dtos);


}
